<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
   <title>数据管理</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>
<?php
	require_once("../utils/upload.php");
	require_once("../utils/db.php");
	$conn=connect();
	$f=false;
	$hob=implode($_POST['like'],",");
	//echo $hob;
	
	$pic_path=GetPic("tx","upload/","0");
	$sql="insert into fishvideo_users values(null,'{$_POST['name']}',md5('{$_POST['pwd']}'),
	'{$_POST['sex']}','{$_POST['bir']}','{$hob}',
	'{$_POST['xl']}','{$_POST['zwjs']}','{$pic_path}');";
	//echo $sql;
	mysql_query($sql,$conn);
	$num=mysql_affected_rows($conn);
	echo $num;
	$url="";
	if($num<1){
		echo "<script>alert('注册失败！');</script>";
		$url="../index.php";
	}else{
		echo "<script>alert('注册成功！');</script>";
		$url="../index.php";
	}
	mysql_close($conn);
	echo "<meta http-equiv='Refresh' content='0;URL={$url}'>"; //跳转界面
?>
</body>
</html>